package com.fangmao.jetpack.room;

import java.util.List;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

/**
 * @ProjectName: wman
 * @Package: com.fangmao.jetpack.room
 * @ClassName: WordDao
 * @Description: java类作用描述
 * @Author: wman
 * @CreateDate: 2020/1/7 15:29
 * @UpdateUser: 更新者
 * @UpdateDate: 2020/1/7 15:29
 * @UpdateRemark: 更新说明
 * @Version: 1.0
 */
@Dao  //DataBase access object
public interface WordDao {
    @Insert
    void insertWord(Word... words);

    @Update
    void updateWord(Word... words);

    @Delete
    void deleteWord(Word... words);

    @Query("delete from word")
    void deleteAllWord();

    @Query("select * from word order by id desc")
    LiveData<List<Word>> getAllWordLive();
}
